import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CustomHistoryVO, CustomHistoryForm, CustomHistoryQuery } from '@/api/wiki/customHistory/types';

/**
 * 查询客户基本信息历史记录列表
 * @param query
 * @returns {*}
 */

export const listCustomHistory = (query?: CustomHistoryQuery): AxiosPromise<CustomHistoryVO[]> => {
  return request({
    url: '/wiki/customHistory/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询客户基本信息历史记录详细
 * @param id
 */
export const getCustomHistory = (id: string | number): AxiosPromise<CustomHistoryVO> => {
  return request({
    url: '/wiki/customHistory/' + id,
    method: 'get'
  });
};

/**
 * 新增客户基本信息历史记录
 * @param data
 */
export const addCustomHistory = (data: CustomHistoryForm) => {
  return request({
    url: '/wiki/customHistory',
    method: 'post',
    data: data
  });
};

/**
 * 修改客户基本信息历史记录
 * @param data
 */
export const updateCustomHistory = (data: CustomHistoryForm) => {
  return request({
    url: '/wiki/customHistory',
    method: 'put',
    data: data
  });
};

/**
 * 删除客户基本信息历史记录
 * @param id
 */
export const delCustomHistory = (id: string | number | Array<string | number>) => {
  return request({
    url: '/wiki/customHistory/' + id,
    method: 'delete'
  });
};
